added advanced options and print to file