slight restructuring of sirbot.py