more performance improvements to  K