Implemented algorithm - NOT YET VERIFIED
added root arc