Update brains.py

I did most the work