Brain 2.0

Implemented new logic based on the working functionality of the
previous code