Pseudo code for parse function