Changed floodFill to an iterative version instead of recursive (which causes crashes on Windows due to smaller stack size)