make subproduct solving work