Attempted re-sort functionality added to views.js