Ported to Microsoft Visual C++ 2010