On the nature and purpose of beauty