Added a* function to exit the program