added copyFrom functions to copy struct data.