[expand] Add variant support

This PR adds variant support to the expand algorithm.