add Distance type and define public functions