made the buffer size configurable