list in c++ have linear complexit compute size, fix this problem that was cousing low perfornamces. Fix a possible bug