Added path finding to js