updated hist funct