Added CCW check code