adding array and new buffer code