let update_val value key tbl = try let v = Hashtbl.find tbl key in Hashtbl.replace tbl key (v + value); with | Not_found -> Hashtbl.add tbl key value