fix creating variants and add tests
Merge pull request #57 from drwelby/master

fix creating variants and add tests