Near final scanline code