addded functions to save to ROOT, updated