I believe the length is defined incorrectly in the decode function it had length = 25 instead of length =26.