Added a clever layout mechanism.