Scanning mostly done, encode roughed out