Added some very basic error handling. Application now exits if xgamma is not found