added key commands to pause and restart the animation