Added QR support, restructured some code to support