Added copy-on-write array implementation