Added comments and made some corrections