Made changes to the way optional useDistance parameter is used. Relevant to comments on commit 67163a4