added atom types, defined typing rules and helper functions