switching sort to return values not bools