mpwm_decoder now working; eliminated problem with negative weights and redundant pairs