addded functions to save to ROOT