WIP; added grouping by deletions and others, some unit tests