removed histograms and fixed the but of std::bad_alloc which was there becuase of nlayers