A better approach to my wget script