move updateTime to own function, minor fixes