added logic to scanner, some ui elements