I had a brain malfunction and thought that time was constantly changing the value. It's not though, haha.

Seems like a really elegant and effective algorithm.