 function [rxn_data, num_new, rxgp] = prepare_uni_rxn(rxn, rxgp, cmpd_name, unitype)
 
 num_new = 0;
  
 switch unitype         
     
     case {1}           
         if rxn.ltor.rate ~= 0     
             num_new = num_new + 1;
             rxn_data{num_new}.type = 'uni-uni';
             rxn_data{num_new}.name = rxn.name;
             
             rxgp = build_comps(rxn.lhs{1,1}, rxgp, cmpd_name);
             comp_id = find_comp_id(rxn.lhs{1,1}, rxgp.comps);
             rxn_data{num_new}.substrates(1,1) = comp_id;
             
             rxgp = build_comps(rxn.rhs{1,1}, rxgp, cmpd_name);
             comp_id = find_comp_id(rxn.rhs{1,1}, rxgp.comps);
             rxn_data{num_new}.products(1,1) = comp_id;
             
             rxn_data{num_new}.StoP = rxn.ltor;
             rxn_data{num_new}.StoP_name = [rxn.name '.ltor.rate'];
         end
         if rxn.rtol.rate ~= 0 
             num_new = num_new + 1;
             rxn_data{num_new}.type = 'uni-uni';
             rxn_data{num_new}.name = rxn.name;
             
             rxgp = build_comps(rxn.rhs{1,1}, rxgp, cmpd_name);
             comp_id = find_comp_id(rxn.rhs{1,1}, rxgp.comps);
             rxn_data{num_new}.substrates(1,1) = comp_id;      
             
             rxgp = build_comps(rxn.lhs{1,1}, rxgp, cmpd_name);
             comp_id = find_comp_id(rxn.lhs{1,1}, rxgp.comps);
             rxn_data{num_new}.products(1,1) = comp_id; 
             
             rxn_data{num_new}.StoP = rxn.rtol;
             rxn_data{num_new}.StoP_name = [rxn.name '.rtol.rate'];
         end
     case {2}           
         if rxn.ltor.rate ~= 0;       
             
             num_new = num_new + 1;                                
             rxn_data{num_new}.type = 'uni-multi';
             rxn_data{num_new}.name = rxn.name;
             rxgp = build_comps(rxn.lhs{1,1}, rxgp, cmpd_name);
             comp_id = find_comp_id(rxn.lhs{1,1}, rxgp.comps);
             rxn_data{num_new}.substrates(1,1) = comp_id;   

            num_prods = size(rxn.rhs,1);
            for i = 1:num_prods
                rxgp = build_comps(rxn.rhs{i,2}, rxgp, cmpd_name);
                comp_id = find_comp_id(rxn.rhs{i,2},rxgp.comps);
                rxn_data{num_new}.products(i,2) = rxn.rhs{i,1};
                rxn_data{num_new}.products(i,1) = comp_id;
            end
             
             rxn_data{num_new}.StoP = rxn.ltor;
             xn_data{num_new}.StoP_name = [rxn.name '.ltor.rate'];
         end
 end             