Decoding Error-correcting codes mathematics