avoiding for-loop

i'll try to figure out how to avoid ``tmp`` calculation with ``np.einsum`` if it possible:)