Added functionality to pause with the spacebar