Added code for processing ntuples