probablistic algorithm ---> making the grader happy