correct bug in decomp algo