added logic comparisons to grammar