Layout function.