implemented scan generator and its unittests