Simulation with classes