Remove unused copyOfArray variable