convolution example refactored