Decode loop