Added Brain class and modified agent files