fixed errors in spawn location code; added astar algorithm