export decode function