Generate Variable Numbers of Codes