much simpler grammar implementation