make buffer size adjustable