finish function 6