added the comments and final touches