Moved state vector to a class.