Removed some print statements.
Fixed some bugs in getNeighbors and refactored it to be more efficient.