copyOut method, with tests