Histogram is now calculated without use of library-functions