Various floodfill algorithms implementation