correct calculation number of connections