Added comments and removed console.logs