Update sat.py

added more debug logging, some code clean up