refactored bob.py