Added function to write on file combinations