faster cut vertex algorithm, fixed bug with debug