code: def _update_lhs(lhs, xCore, zCore, new_lhs):
      
      # TODO: Use intermediate variable to use 5 nested loops instead of 6.
      r_old_x, n, r_x = xCore.shape
      num_obj, r_old_z, n, r_z = zCore.shape
      for idx in range(num_obj):
          for val in range(n):
              for alpha_old_z in range(r_old_z):
                  for alpha_z in range(r_z):
                      for alpha_old_x in range(r_old_x):
                          for alpha_x in range(r_x):
                              curr_value = lhs[idx, alpha_old_x, alpha_old_z]
                              curr_value *= xCore[alpha_old_x, val, alpha_x]
                              curr_value *= zCore[idx, alpha_old_z, val, alpha_z]
                              new_lhs[idx, alpha_x, alpha_z] += curr_value
docs: Function to be called from the project()