Added spacebar toggle functionality