Main 50% complete

Worked on the main core winmain is complete for most part.