Creating a histogram with code