removed elsif from recursive sorting method