Stuffed the console script in a console function