added function to count hubs. might need a little more work