Error Correcting Code, the existing code was helpful but has mostly been completely redone in the process