Trouble with wireless relay control project

Thanks a bunch, I really for some reason have trouble keeping track of all of the loops. Took only a few minutes to get my code working after your help.