fix the fourth requirement and fix the bug while crossing the initiate distance