add time based rolling function