refactored shiftReduce to support addition of more binary operators