avoided sysout and array copy