add apply and update vector
add io and update function