added logic/tests for catching invalid/unrecognized tokens in equation