Add no of paths function