pythagoras also held that humanitys highest purposeand all else was incidental or secondarywas to purify the soul by cultivating intellectual virtues , refraining from sensual pleasures , and by practicing special religious rituals .