Added functional return values for sorts