use ~ range for when