corrected array boundary violation in histogramm subroutine