Edited Algorithms to work with the new models.