increased buffer size and other bugs