-Changed BufferedWriter to PrintStream
-Added more exception handlers