Added run-time parameter for number of ticks