Floodfill recursive algorithm