Updating to simpler code to copy array