addition of mean and median calculations along with cleaned up hisogram