Comments and code cleanup.
Moved shared variables to app delegate.