Added comments and made few required changes