Distance fix

addresses issue #13