small change to update_attributes
added tests and corrected class inheritance