converted to use time in millis