optimized whole kernel