removed some of the unnecessary console.log and filled out some comments for execution flow