new floodfill implementation