why not use an ArrayBuffer since the listbuffer is converted to an array later anyway?