corrected some variable declaration errors