made floodfill more efficient