Added a* algorithm