Understanding the relationship between openness and income inequality in two economies