Working simulation (still takes longer than expected - searching for bug)