fixed some bugs
added containsWithinDistance method