psuedocode for file input, moved types to single file