implementation of cond range