Added --hist
Lodsa fixes