Changes to enable compiling under windows.  Program crashes for some unknown reason- need to debug.