Added file output and ability to load from file.