Restarting refraction with detph first search