Updated to use EXIT_FAILURE and EXIT_SUCCESS