Basic sorting functionality now working.