A tottering program I made. Please give me advice.