Added histogram drawing functionality