Use ArrayBuffer to speed up append operations