contract IndexConsumer {

    using SafeMath for uint256;

    /** The index */
    uint256 private freshIndex = 0;

    /** Fetch the next index */
    function nextIndex() internal returns (uint256) {
        uint256 theIndex = freshIndex;
        freshIndex = freshIndex.add(1);
        return theIndex;
    }

}
/** 
 * @title IndexConsumer
 * @dev This contract adds an autoincrementing index to contracts. 
 */
function nextIndex() internal returns (uint256) {
    uint256 theIndex = freshIndex;
    freshIndex = freshIndex.add(1);
    return theIndex;
}

/** Fetch the next index */