Lots of improvements and works on windows