cleaned up python code
halved output histograms
moved metadata to the back of the output array
more compact histogram format seems to work work now