Updated kernel generation script