Added code_confirm and exists functions