Fixed Bugs: Wrong Input for ScanLine Function