Added general layout method to prepare automatic layout