Adding pooling and buffer resizing