Monte Carlo simulation of the Potts model