Has some more efficient code, commented out because I was having trouble getting it to work. However, it may have been due to the particular data I was trying to decode and CRC-validate.