modify powersystem.py