Added code comments to histogram, fixed possible zero division