I don't know where the problem is. I check for the 4 adjoining cells as the diagonal joining ones don't count (I think?) and change them if they are the same color as the original. Then I check for each of those changed cells if their adjoining are different and so on. I safe the changes to a variable, and in the end change the image from the original method into the changed one as they want you to modify the image even though nobody ever gets to it as there is no return for it and return true.