Added getNearObjects function