making background selection more flexible