Scan optimization changes + Added Offset test cases + changed preprocess...

...or definition