applied joe's code generator to 'resend code' function