- added sorting when saving the impedance file
- fixed scaling bug