renamed elapsedTime to deltaTime