Cleaned up some code, formatted output now appears properly