public void forward(double amount) 
      {
         double dx = amount * Math.cos(heading * Math.PI / 180);
         double dy = amount * Math.sin(heading * Math.PI / 180);
      
         double temp1 = xPos + dx;
         double temp2 = yPos - dy;
      
         ((Graphics2D)graphics1).setStroke(new BasicStroke(thickness));
      
         double oldX = xPos;
         double oldY = yPos;
      
         if(crawlOff)
         {
            xPos = xPos + dx;
            yPos = yPos - dy;
            if(penIsDown)
            {
               graphics1.setColor(turtleColor);
               graphics1.drawLine((int)(0.5 + oldX), (int)(0.5 + oldY),
                                    (int)(0.5 + xPos), (int)(0.5 + yPos));
               graphics2.drawImage(buffer1, 0, 0, WIDTH, HEIGHT, null);
            }
         }
         else
         {
            double track = 3.0, sum = 0;
            boolean done = false;
            while(!done)
            {
               xPos = oldX + track * Math.cos(heading * Math.PI / 180);
               yPos = oldY - track * Math.sin(heading * Math.PI / 180);
               if(penIsDown)
               {
                  graphics1.setColor(turtleColor);
                  graphics1.drawLine((int)(0.5 + oldX), (int)(0.5 + oldY),
                                       (int)(0.5 + xPos), (int)(0.5 + yPos));
               }
               graphics2.drawImage(buffer1, 0, 0, WIDTH, HEIGHT, null);
               pause();
               oldX = xPos;
               oldY = yPos;
               if(sum + 2 * track >= amount)
                  done = true;
               sum += track;
            }
            if(penIsDown)
            {
               graphics1.setColor(turtleColor);
               graphics1.drawLine((int)(0.5 + xPos), (int)(0.5 + yPos),
                                    (int)(0.5 + temp1), (int)(0.5 + temp2));
            }
            graphics2.drawImage(buffer1, 0, 0, WIDTH, HEIGHT, null);
            pause();
            xPos = temp1;
            yPos = temp2;
            graphics2.drawImage(buffer1, 0, 0, WIDTH, HEIGHT, null);
            pause();
         }
      }