Added scan functionality