output to file added

I also started planning  on the gui