moved variable declarations out of "if" statements
removed comment