Added a 'checkModel' function, and parsing of a model.  Other small changes