Imported the appropriate libraries
Rewrote saveFile method(probably will rewrite it again)