fixed sillyness with global var naming issues and a spelling mistake while we're there