fixed a mistake. Now it works right. Program makes more than only one step