Modeling confirmation bias and polarization