refining script's output