Latest code. added RFID support