Moved data to model. edited sort methods

Moved data to model. edited sort methods