Updated util copy method, now handle arrays