completed first function