Fixed timing errors and made updateTime more accurate