the above line is completely untested and probably doesn't work, but sort of gets the gist across.