allocated dynamic temps from heap instead of stack to get to compile with msvc2010
msvc2010 compilation helps/fixes