added function to find path with certain length.
performance is good