added DB table and sql statements for it. Also some UI changes for expanded activitites.