disance rule implemented