hist code restructuring

+ new different function for update on hash moves