Outputs data to a file now. Also fixed some formatting issues