Changed floodFill function to x and y coordinates