refactored add_character