add function for copy array and reference array