added more checks for cross platform, also made a default output file