Changed to using pointers instead for points and contours