Implemented a batch buffer, fixed #28