Added possibility to simulate only a given number of cycles, for benchmarking purposes.