added some code for receipt decoding