made timeElapsed work correctly