remove args dependence on file write
WIP: apply_pml() still rough