Generalized moving to new states. Added a few more necessary inputs.