Sorting

Sorting has been hooked into the app and is ready to be merged into master branch.