test functions in main.js simplified