First, the code posted is still a bit hard to read with the lack of indenting.

Second, you've got quite a few questions associated with this, and its hard to direct all of them. That being said,...