dinamically allocating buffers