filled in write_vector and load_vector