Update main.js

Updated some cases to correct issues with all functions