this is c++. please declare variables right before they are really used.