Rearragned some of the grammar to have priorities.