added a unit test for testing neighbors. Worked. Fixed a bug in the distance calculation where the peridicity was negleced.