Added MS Windows implementation of the same basic idea