Create retire function