Modified floodfillalgorithm.cpp