I think this works, but I haven't tested it yet.