Added shape agnostic CopyTo() function.