move declarations to top of fcn for MSVC < 2013