Added decoding to struct