how the mind creates pain