'temp_dis' is a variable just used to for storing and checking if the current distance is less than 'MID' variable or not. In case it is less then we will keep incrementing it and in-case it becomes equal or greater then we shall increase the count of our total balls in order to compare them with variable 'm'