moved writeToClone to copy constructor