TiledSharp camera restrictions?

Hey there everyone,

I created a map, have a character and have the character movement restricted to inside the map, but what I’m trying to do now is restrict the camera from exiting the map also and the map.mapHeight is not keeping the camera from leaving the screen. I used the map.mapHeight to prevent the character from exiting and it works perfectly.

screen shot:

This is where I’m setting Lobby.mapWidth in the Lobby class:

    public static int mapWidth, mapHeight;

    public void LoadContent(ContentManager Content) {
        map = new TmxMap("Content/Maps/Start2.tmx");
        tileset = Content.Load<Texture2D>("Maps/" + map.Tilesets[0].Name.ToString());

        mapWidth = map.Width * 32 - 30;
        mapHeight = map.Height * 32 - 34;

heres what I have as far as code goes in my camera class:

  public void Update(Vector2 playerPosition) {
        position.X = playerPosition.X - (ScreenWidth / 2);
        position.Y = playerPosition.Y - (ScreenHeight / 2);

        if(position.X < 0) {
            position.X = 0;
        } else if(position.X >= Lobby.mapWidth) {
            position.X = Lobby.mapWidth;
        }
        if(position.Y < 0) {
            position.Y = 0;
        }else if (position.Y > Lobby.mapHeight) {
            position.Y = Lobby.mapHeight;
            
        }
        //Moves screen towards the left
        viewMatrix = Matrix.CreateTranslation(new Vector3(-position, 0));
    }