Added neighbor functions. Closes #38.