added distance param; need to update tests