added matematical functions to main.js