Updated to use main element.