Functions for spacebar and print