Port to VS 2012
ported to VS2012