s/indexes/indicies and moved single minibatch iteration to it's own function