complete logic of summary activity