Made main.js more efficient and updated README