added preliminary support for custom kernels