working on fire algorithm, too slow