protected override void OnUpdateFrame(FrameEventArgs e)
        {
            base.OnUpdateFrame(e);

            //TODO put up win/lose banners
            if (gameWon && !gameCleaned)
            {
                Mouse.ButtonUp   -= Mouse_ButtonUp;
                Mouse.ButtonDown -= Mouse_ButtonDown;

                gameCleaned = true;
            }

            else if (gameOver && !gameCleaned)
            {
                foreach (Tile[] ta in tileset)
                {
                    foreach (Tile t in ta)
                    {
                        t.MouseUp();
                    }
                }

                Mouse.ButtonUp   -= Mouse_ButtonUp;
                Mouse.ButtonDown -= Mouse_ButtonDown;

                gameCleaned = true;
            }

            else if (!gameOver)
            {
                //mouse tracking code
                Point tileCoords = new Point((int)Math.Floor((float)Mouse.X * (float)tileset[0].Length / (float)ClientSize.Width), (int)Math.Floor((float)(ClientSize.Height - Mouse.Y) * (float)tileset.Length / (float)ClientSize.Height));
                if (tileCoords.X < tileset[0].Length && tileCoords.Y < tileset.Length)
                {
                    if (hoveringTile != tileset[tileCoords.Y][tileCoords.X])
                    {
                        hoveringTile.Unhover();
                        hoveringTile = tileset[tileCoords.Y][tileCoords.X];
                        hoveringTile.Hover();
                    }
                }
            }
        }
        void Mouse_ButtonUp(object sender, MouseButtonEventArgs e)
        {
            if (hoveringTile != null)
            {
                if (e.Button == MouseButton.Left)
                {
                    hoveringTile.MouseUp();
                    hoveringTile.Hover();

                    if (hoveringTile.Type == TileType.EMPTY)
                    {
                        ShowAllBorderingEmpties(hoveringTile);
                    }

                    if (hoveringTile.Type == TileType.MINE && hoveringTile.Visible)
                    {
                        gameOver = true;
                    }
                    else
                    {
                        gameWon = true;

                        //check for game won
                        foreach (Tile[] ta in tileset)
                        {
                            foreach (Tile t in ta)
                            {
                                if (t.Type != TileType.MINE && !t.Visible)
                                {
                                    gameWon = false;
                                }
                            }
                        }
                    }
                }
            }
        }
        protected override void OnUpdateFrame(FrameEventArgs e)
        {
            base.OnUpdateFrame(e);

            //TODO put up win/lose banners
            if (gameWon && !gameCleaned)
            {
                Mouse.ButtonUp -= Mouse_ButtonUp;
                Mouse.ButtonDown -= Mouse_ButtonDown;

                gameCleaned = true;
            }

            else if (gameOver && !gameCleaned)
            {
                foreach (Tile[] ta in tileset)
                {
                    foreach (Tile t in ta)
                    {
                        t.MouseUp();
                    }
                }

                Mouse.ButtonUp -= Mouse_ButtonUp;
                Mouse.ButtonDown -= Mouse_ButtonDown;

                gameCleaned = true;
            }

            else if (!gameOver)
            {
                //mouse tracking code
                Point tileCoords = new Point((int)Math.Floor((float)Mouse.X * (float)tileset[0].Length / (float)ClientSize.Width), (int)Math.Floor((float)(ClientSize.Height - Mouse.Y) * (float)tileset.Length / (float)ClientSize.Height));
                if (tileCoords.X < tileset[0].Length && tileCoords.Y < tileset.Length)
                {
                    if (hoveringTile != tileset[tileCoords.Y][tileCoords.X])
                    {
                        hoveringTile.Unhover();
                        hoveringTile = tileset[tileCoords.Y][tileCoords.X];
                        hoveringTile.Hover();
                    }
                }
            }
        }