The workings of the mind