finished kruscal! but it's slower than python version