improved pairs counting, fixed issues with having not assigned clusters