calculate Distance