modified some of the list function after reviewing the sorting course