added gen and check to top