finish two functions