fix time, added range function