made rules left recursive where appropriate in grammar