Move parse function to bottom of file
Reimplement parse_file function in C