use sorted list, not unsorted, duh