fixed histograms, added undo