The fork version of the code after implementing the flood fill algorithm