Added a sort method to models