Changed buffer size to the same as the old code