Updated DFS and GBFS so that they are not recursive, they are still horribly slow