Added tests, output file etc.