more efficient way to copy data