fix issue #11: sample_file does not work for optim
fix issue #11 2, no sample_file for optim
more doc for new argument scheme