change exit(0) in main function to return 0