tried building scanner from scratch, didnt understand what the scanner did previously