added some tools for convolution