• 3 pounds Yukon Gold potatoes, sliced 1/8-inch.
• 1/2 medium yellow onion, thinly sliced.
• 3 tablespoons unsalted butter.
• 1/4 cup all-purpose flour.
• 4 garlic cloves, grated.
• 1 tablespoon fresh thyme leaves.
• 1/2 teaspoon black pepper.
• 1 1/2 cups cheddar cheese, grated.
• Butter for greasing pan.