#643: Corrected,added distance measures