Issue with KOSMOS-2 encoding and decoding

Let me know how it goes!