Cleaned up the grammar a bit. Currently works for most cases, except those composed of a valid input followed by unexpected tokens.