Visual Studio 2012 version

Source modified for VS2012 compatibility