Added centering to the generating of the state vector