separate files for classes, updated grammar