for comparison
improved pooling functions