added comments to qualitymodis.py
slight reordering of code in qualitymodis.py