added average pooling