properly cloning arrays and strings