substituted moses.R with desktop version