added brain fcn and new way to deal with the  tools