tweaking histogram calculations