kernel now works at all optimization levels