clean output in spn.py