added functions for generating equations in main.js