Much neater solution to the buffer size problem