Adding a scan function to app