incorporated forest fire algorithm to identify connected objects