Charitable giving and cognitive ability