little rearrangement of WinMain function