finishing off QR functionality (will need testing)