Clean up typewriter function