Refactored code, added brain model