refractored, bfs and a* now work with gameobject