second shot at implementing qsort