rewrite of wide_class
adapted rpkc_s