implement summary, fix unitests