Complete rewirte of ntuple maker code