implement Decode()