child.js - initial State Machine code