```\nfunction getPurchasedAmount(address holder) public returns (uint amount) {\n    // check if any delegation was ended\n    for (uint i = 0; i < \_endingDelegations[holder].length; ++i) {\n        getState(\_endingDelegations[holder][i]);\n    }\n    return \_purchased[holder];\n```\n