Decoding code for the toSpecificRecord function...