Functions in gamelayer