My own sorting method.