change to duck typing for range parameter