fix creating variants and add tests

incorporated some changes and started with a clean repo