Windows friendly code added. Bugs removed. And so on...
Fixes and improvements
Duplicated code removed. Calculation fully moved from GUI