Extracted out x_ei(), and x_ee_y_ie() terms
Extracted remove_padding() step from add_padding()