Swap recursive fill algorithm to queue-based to avoid stack overflows over big regions