Removed uneccessary output from mw_func, cleanup, and gen.