sort is not useful. use toArray().sort() instead
be consistent with terminology. things in the list are items not elements.
clean up code