Skeletal draft of step 9 (run as JS)