Added new formatter function and allowing arrays to be saved to a file in addition to stdout