We should probably check to make sure that `environment` exists before accessing its `id` (since we're counting on the application developer to set the `terrainName` property).

I might also suggest naming the variable `terrain` instead of `environment` (since `environment` is just what we happened to name the terrain in our app).