if    SEARCH
then DELETE  
    return 1
else  GETENCMSG  
if  
then if SEARCHC
    then  
if  
    then INSERTDB  
       return 0
INSERTDB  
Algorithm 3