I don’t see you declaring a distance in your class, but use it under the update. Declare the distance as a private float with other members and simply define it at the beginning.
Assuming your code is not exactly like that, your problem also looks due to using a solid value with distance. Try using less than or equal to 20.
if(distance <= 20)
19 21.
if(distance <= 21 && distance >= 19)