Added comments and made few small changes