Updated CH resolved code to use real distance.