first draft of helper script (start of #2)