added proper tostring method and a distance method