added comments and pseudo code to parse method