Completed setAttributes() method