Added generator functions to main.js.