Added formulas and finished basic engine.js functionality