Added tests and file output.