Added comments and made adjustments