chain copying looks like solved (Although need to know max chain length to reserve array, or use another chain instead array %) )