removed diamond
used arraycopy to set array.
refactoring