generalized and commented range finding