patched to run on Windows platform