remain function