adjust time controller algorithm