Fixed Printfs.
Moved write to file to Application class.