spRaiseDead

Originally, I had planned to combine the code from Regrowth and Raise Dead for a new keyword. Add in additional coding and we would be able to include a few more spells. After a few weeks I decided to scale this down to just a Raise Dead type keyword.
At this time the keyword looks like this:
spReturnGraveyardHandCreature:{num}/{Quantifier}
After setting this up to handle the four Raise Dead spells I placed the code within a while loop. This allows for Death's Duet to be added. Death's Duet is set up to require a minimum of two creatures in your graveyard and you have to return two creatures. I believe that this is rules compliant.
I am now in the process of modifying the code to use "getChoiceOptional" to prepare for Urborg Uprising which states "Return up to two target creature cards from your graveyard to your hand."
I assume that you can cast this card and return 0, 1 or 2 creatures. Is this interpretation of the rules correct? I assume that I should restrict the AI to casting this only if there is two or more creatures in the computer's graveyard.
At this time the keyword looks like this:
spReturnGraveyardHandCreature:{num}/{Quantifier}
After setting this up to handle the four Raise Dead spells I placed the code within a while loop. This allows for Death's Duet to be added. Death's Duet is set up to require a minimum of two creatures in your graveyard and you have to return two creatures. I believe that this is rules compliant.
I am now in the process of modifying the code to use "getChoiceOptional" to prepare for Urborg Uprising which states "Return up to two target creature cards from your graveyard to your hand."
I assume that you can cast this card and return 0, 1 or 2 creatures. Is this interpretation of the rules correct? I assume that I should restrict the AI to casting this only if there is two or more creatures in the computer's graveyard.