parameterized distance code