fixed x-y order in ccw algorithm