fixing bug in depth counting
use probabilistic edge sampling
code refactoring
error in path printing
code refac.