added outputIdxs matrix and numOutputIdxs, appropriate reading code, writing code in writeChubukov. test function in innermost loop of BeliefPropagation, iterates nextOutputIdx unless at end of outputIdxs