Implement grammar + bug fixes to make code compile