finish version function