first attemt at fix
Fixes from RJ now added and histogram also plotted
Fixed bug with pickling