Use arrayCopy instead of manual copy