added layout_debug function