optimizing code for windows