adding histogram (buggy)