removed unused var r and updated comments.
comments updated.
JSDoc comments added to app.js
merged.
JSDoc comments added to engine.js