adding layout rules and elements