added hist fucntion