Corrected syntax error in distance method