fixed bug in step.count computation