Also, you should add an `else` condition raising a `ValueError` if the layout cannot be determined.