new pattern, updated main.js example