add flag for writing expected output