using vector for buffers, removed some redundant code