Added a model legality checker for linting