added vanilla layer
fixed random vanilla layer bug
put gamelayertype handling into functions