improwed mixin, removed index, added main