distance method as 'static'