Error Correction Coding: Mathematical Methods and Algorithm