added hist function