psutils needed to use ionice
better errror message using assert, re-arrage some