updated for mingw