improved kernels, added tests