implemented newarray