new traversing algorithm that fixes tanglement

Signed-off-by: Daniel Fagnan <dnfagnan@gmail.com>