simple version from ZXing