filename.dat is input data, filename.out is output generated