converted setTimeouts to a tick instead