Stopped instantiation of var result from copying array references -- fixes bug where input array was mutated.