Approximate distances

Fixes #257