init by copy code