Made write_results work somehow.