the function of next()