Added comments and small fix