Implemented repo unit count calculation