windows OS compatibility & some cleaning of the code