sorted and unsorted list functionality works