Adding histogram code