Updated to work with QR codes