Implemented a 'marching squares' algorithm for detection of the perimeter of the created shape.