this won't compile on old windows compilers, the declaration must be at the beginning of a block