added experimental environment detection