finished convex hull algorithm