better console script code