Indeed! I forgot to redirect, but your solution looks even better (though I did not run it).