Fixed the layout stuff once and for all