Need help for Arduino with stepper motor

Hello. I have the following problem: After creating an app that is supposed to turn a stepper motor with just two buttons, it sometimes turns left and sometimes right. Sometimes the motor changes direction just by pressing the button repeatedly. Where could my mistake be?

My goal:
Press the left button - turn the motor left
Press the right button - turn the motor clockwise


My Code on Pastebin