several changes to accomodate cygwin