Modified code to support CYGWIN