Added sort functionality on homepage