public void paint(Graphics window) {
        Graphics2D g2d = (Graphics2D) window;
        // the frame is 550 wide, the bg image is 900 wide

        if (nX1 < -1000) {
            nX1 = nX2 + nWidth; //move it to the far right
        } else if (nX2 < -1000) {
            nX2 = nX1 + nWidth; //move it to the far right
        }
        if (nX2 > 800) {
            nX2 = nX1 - nWidth;
        } else if (nX1 > 800) {
            nX1 = nX2 - nWidth;
        }
        System.out.println(nX1 + " is nX1 and the next is nX2 " + nX2);
        g2d.drawImage(b1, nX1, 0, null);
        g2d.drawImage(b2, nX2, 0, null);
    }