Code only works correctly the first time?

I'll also get you a schematic. Stand by!