Fixed add_key, refactored remove_key