Added the function of time tracking. Cleanup.