private static void run() throws InterruptedException {
        while (!finished) {
            // Always call Window.update(), all the time
            Display.update();
            if (Display.isCloseRequested()) {
                // Check for O/S close requests
                finished = true;
            } else if (Display.isActive()) {
                grue.logic();
                grue.render();
                Display.sync(FRAMERATE);
            } else {
                Thread.sleep(100);
                if (Display.isVisible() || Display.isDirty()) {
                    grue.logic();
                    grue.render();
                }
            }
        }
    }