Updating sorting to handle all Comparable[T] types.