fixes to variable names; add out of memory return code to GetNeighbors()