Can you ever envision `states` getting longer than say 100 elements? Currently this will create a new list of length `states` (pointing to the same objects) each `step`, which shouldn't be a concern for < 100 elements, but otherwise could be a source of slowness since `step` is critical .