Moved to outputting to a file