The above (with some changes) appears to work, plus I moved the loop into The Right Place.  Update coming once I have wifi.