Input and Output helper functions.