Adding models.  Moved code around for organization.