corrected bug in sort, sort test passes again