completed further work on statevector