merged and squashed accelerate branch into nk