Rewrote the scanner
Added fully buffered scanning