copy is mostly done