Add most_recent_state function