Removed Global Variables. Cleaned up some test code