Updated kernel implementation