finish vector version,still has exit bug