adding a copy of example02.cc for Root-based usage