updated for msvc and building