Decoder class solving the problem