def g_learn_rolling(t, g_learner, exp_returns, sigma, returns):
    """
    Call g-learning rolling class functions to output optimal weight and update g-learning rolling class
    Parameters
    ----------
    t : the step number (t+1)
    g_learner : the g-learning rolling class
    exp_returns : expected return at the t+1th step
    sigma : assets return covariance matrix at the t+1th step
    returns : actual returns at the t+1th step

    Returns
    -------
    optimal weight at the t+1th step, and the updated g_learning rolling class
    """
    if t == 0:
        g_learner.update_before_step_1(t)

    weight = g_learner.run(t, exp_returns, sigma)
    g_learner.update(t, returns)

    return weight, g_learner