While the onions are cooking, peel the potatoes and slice finely (it’s much quicker to use a mandolin if you have one). Now put a messy couple of layers of potato slices in an ovenproof dish, season, sprinkle over some lemon thyme (if using) and caramelised onions. Continue layering until all the ingredients are used up. Pour the stock into the dish until it comes about two thirds of the way up the potatoes. Dot the top with the remaining butter and cook for about 90 minutes, or until the potatoes are soft in the middle and crisp and brown on top.