updated to require.js. added program handling