def gradient_step(local_gradients, local_centroids):
    """
        Gradient descent update on local site

        Input: local_gradients - list of k many local gradients

        Output: updated local centroids, previous centroids from last iteration
    """
    previous = local_centroids[:]
    local_centroids = [
        wk + local_gradients[k] for k, wk in enumerate(local_centroids)
    ]
    return local_centroids, previous