new sorting algorithm implemented (finished)