adding distance option. closes #1