implemented scanning grid generation