Adding in decoding code