now caluclates distance