modifications on slave.py