improved structure and added buttons for running and stepping