Correction. Works now for weighted and unweighted temporal graphs