created universal sort testing method