moved function calls into main.js