added sorting functionality (order by party still not enabled)