improved isog_class function and corrected it in the CM (h>1) case