Revert "new distance function (closes #1118)"

This reverts commit d785fd419f9ca20233af24ea475201788a1fb1a9.