implement newarray