Added scan functionality.