public static void main(String[] args) throws UnsupportedLookAndFeelException {

        final Logger l = Logger.getLogger(Load.class.getName());

        Thread cleanupThread = new Thread(
                new Runnable() {
            @Override
            public void run() {
                System.out.println("Shutdown hook ran.");

                otapiJNI.OTAPI_Basic_AppShutdown();
            }
        });

        Runtime.getRuntime().addShutdownHook(cleanupThread);

        int retVal = Loader.Load();

        if (0 < retVal) // success (run Moneychanger)
        {
            launch(Moneychanger.class, args);
        }

        if (0 == retVal) // cancel (just quit, no need to cleanup)
        {
            l.log(Level.WARNING, "Failed to Load. Will not atempt to run Moneychanger!");
            Runtime.getRuntime().removeShutdownHook(cleanupThread);
            System.exit(0);
        }

        if (0 > retVal) // error (quit and cleanup)
        {
            l.log(Level.SEVERE, "Failed to Load. Will not atempt to run Moneychanger!");
            System.exit(0);
        }
    }