strip out FILE pointer for windows compat; memory clean-up issue remains. writing a matlab interface. need to test windows compat