Implemented decoding.