rewrote point comparison to fit qsort specifications