added code for different kernel sizes