A working version with copying metadata