improved colouring, fixed convex hull algorithm

-The colouring was odd due to a misunderstanding regarding the ranges.
Fixed.
-The convex hull algorithm was wrong.