final fixes :D
repaired algorithm implementation and topology drawing.