first version A* ready, not working