finding median from histogram corbettmaths