refactored token functions, updated parse tree