Converts main.js to anonymous function for Bajo