Added histogram functions
Modified example