added buffer size option