changed function in main.js to call the new init ar function