private void loop() {
        while (!Display.isCloseRequested()) {
            glLoadIdentity();
            
            //Keyboard
            if (Keyboard.isKeyDown(Keyboard.KEY_S)) {
                y += .1f;
            } else if (Keyboard.isKeyDown(Keyboard.KEY_W)) {
                y -= .1f;
            }
            if (Keyboard.isKeyDown(Keyboard.KEY_A)) {
                x += .1f;
            } else if (Keyboard.isKeyDown(Keyboard.KEY_D)){
                x -= .1f;
            }
            if (Keyboard.isKeyDown(Keyboard.KEY_Q)) {
                z += .1f;
            } else if (Keyboard.isKeyDown(Keyboard.KEY_E)){
                z -= .1f;
            }
            
            //Mouse
            if (Mouse.isButtonDown(0)) {
                if (!pressed) {
                    // Just clicked down for the first time, need to store this cursor location
                    pressed = true;
                    downx = Mouse.getX();
                    downy = Mouse.getY();
                } else {
                    // Being held down, need to update rotation relative to init location
                    diffy = (float) -(Mouse.getX() - downx);
                    diffx = (float) -(Mouse.getY() - downy);
                    
                    //total distance cursor has traveled to be used for the rotation
                    double distance = Math.sqrt(diffx * diffx + diffy * diffy);
                    //20 pixels will be 180 degrees of rotation
                    //glRotatef uses DEGREES, NOT RADIANS
                    rotation = (float) (distance / 3.0);
                }
            } else {
                pressed = false;
            }
            
            //Draw
            draw();
        }
    }