added decomposeBetti method