initial fully working version on Windows