Added Decode function