Added some more magic to layout