Dynamically calculated time offset

Instead of hard-coding currentTime offset, dynamically calculate it.