Foundations of Coding Theory