Removed histograms and fixed some parts to make working