rather to my surprise , while he knit his brows over the situation and muttered uncomplimentary things under his breath in gaelic about both louise and charles stuart , he agreed with my solution to the problem .