Fix formatting. Print output to file. Still issues with euler loop