fixed bug with last substep
fixing the bug - complited
cleaning code
next bug - not fixed
code cleaning