Moved prune-states to correct position in loop