How The Brain Performs Flexible Computations