better script, with output