declare vars in proper scope