Updated to reflect changes in the API. Added some distance helpers.