change variable names to world and tempWorld
create getNeighbors function