modified to save .root files