Added file output. Some bugs fixed. Again.