cleaned up grammar conversion