Moved logic down into the model now that it works.