- Added code to ensure pixels in a segments are all connected