moved SortedArrayList to new class.