The class sum operator approach for the point group O and D4