function Astar:populate_nodes( scale,nx,ny,nz,world_pos )
 if ( scale == 0 ) then return end
 if ( self.max < 1 ) then return end -- end loop
 if ( !self:node_exists( nx,ny,nz ) ) then return end

 local f = self.F * scale
 local r = self.R * scale
 local u = self.U * scale
 
 local tr = {}
 tr.start = world_pos
 tr.mask = MASK_SOLID
 
 timer.Simple( .05,function()
  if ( !self:node_exists( nx + 1,ny,nz ) && !self:node_exists( nx + 1,ny,nz - 1 ) && !self:node_exists( nx + 1,ny,nz + 1 ) ) then
   tr.endpos = world_pos + f
   local _tr = util.TraceLine( tr )
   if ( !_tr.Hit ) then
    self.max = self.max - 1
    self:create_node( nx + 1,ny,nz,tr.endpos )
    self:populate_nodes( scale,nx + 1,ny,nz,tr.endpos )
   else
    -- Try to spread up and over
    tr.endpos = world_pos + f + u
    local _tr = util.TraceLine( tr )
    if ( !_tr.Hit ) then -- Yay, we can spread up!!
     self.max = self.max - 1
     self:create_node( nx + 1,ny,nz + 1,tr.endpos )
     self:populate_nodes( scale,nx + 1,ny,nz + 1,tr.endpos )
    end
   end
  end
 end )
 
 timer.Simple( .1,function()
  if ( !self:node_exists( nx - 1,ny,nz ) && !self:node_exists( nx - 1,ny,nz - 1 ) && !self:node_exists( nx - 1,ny,nz + 1 ) ) then
   tr.endpos = world_pos - f
   local _tr = util.TraceLine( tr )
   if ( !_tr.Hit ) then
    self.max = self.max - 1
    self:create_node( nx - 1,ny,nz,tr.endpos )
    self:populate_nodes( scale,nx - 1,ny,nz,tr.endpos )
   else
    -- Try to spread up and over
    tr.endpos = world_pos - f + u
    local _tr = util.TraceLine( tr )
    if ( !_tr.Hit ) then -- Yay, we can spread up!
     self.max = self.max - 1
     self:create_node( nx - 1,ny,nz + 1,tr.endpos )
     self:populate_nodes( scale,nx - 1,ny,nz + 1,tr.endpos )
    end
   end
  end
 end )
 
 timer.Simple( .15,function()
  if ( !self:node_exists( nx,ny + 1,nz ) && !self:node_exists( nx,ny + 1,nz - 1 )  && !self:node_exists( nx,ny + 1,nz + 1 ) ) then
   tr.endpos = world_pos + r
   local _tr = util.TraceLine( tr )
   if ( !_tr.Hit ) then
    self.max = self.max - 1
    self:create_node( nx,ny + 1,nz,tr.endpos )
    self:populate_nodes( scale,nx,ny + 1,nz,tr.endpos )
   else
    -- Try to spread up and over
    tr.endpos = world_pos + r + u
    local _tr = util.TraceLine( tr )
    if ( !_tr.Hit ) then -- Yay, we can spread up!
     self.max = self.max - 1
     self:create_node( nx,ny + 1,nz + 1,tr.endpos )
     self:populate_nodes( scale,nx,ny + 1,nz + 1,tr.endpos )
    end
   end
  end
 end )
 
 timer.Simple( .2,function()
  if ( !self:node_exists( nx,ny - 1,nz ) && !self:node_exists( nx,ny - 1,nz - 1 ) && !self:node_exists( nx,ny - 1,nz + 1 ) ) then
   tr.endpos = world_pos - r
   local _tr = util.TraceLine( tr )
   if ( !_tr.Hit ) then
    self.max = self.max - 1
    self:create_node( nx,ny - 1,nz,tr.endpos )
    self:populate_nodes( scale,nx,ny - 1,nz,tr.endpos)
   else
    -- Try to spread up and over
    tr.endpos = world_pos - r + u
    local _tr = util.TraceLine( tr )
    if ( !_tr.Hit ) then -- Yay, we can spread up!
     self.max = self.max - 1
     self:create_node( nx,ny - 1,nz + 1,tr.endpos )
     self:populate_nodes( scale,nx,ny - 1,nz + 1,tr.endpos )
    end
   end
  end
 end )
end