calc functions from app.js