converted layout.js to funcjs arch