learning to use attr