Added option so that results summary can be printed to a file rather than stdout