Untested, I hope this works.