Variables swap when I close the Ai2

When an apps' blocks look like a box of combs, it means they have not yet learned how to use lists, procedure parameters, and generic blocks.

Your block count could be reduced by a factor of 10.

http://www.appinventor.org/bookChapters/chapter21.pdf

http://www.appinventor.org/book2