Keeping track of visited pixels was quite easy. But this still needs a lot of improvement