Add code for spacebar functionality