some serial optimizations, step and inverseStep