Create sorting algorithm