In a mixing bowl cream sugar and margarine until fluffy. Add egg(or flax replacer) and vanilla. Beat well. In another bowl, combine the rice flour, sorghum flour, potato starch, tapioca flour, corn starch, xanthan gum, salt and baking powder. Mix well. Add flour mixture to the sugar mixture in mixing bowl. Beat until combined. Scrape down mixing bowl and mix again until all combined. Add toasted nuts and mix until combined. Chill dough for one hour.