changed state builder function to build_stable_state for clarity