modified summerize code