make buffer size configurable