function TProcess.Run : TStringList;
var DestinationFrameNum, tempint, VerticalBobOffset, A, B : integer;
    TorsoFile, LegsFile, WeaponFile, LeftArmFile, RightArmFile : string;
    NewImage : TImage;
    FileList : TStringList;
begin
  FileList := TStringList.Create;
  FileList.Clear;
  //****Still Frames****
  For A := 1 to 8 do
  begin
    //set body/weapon/legs frame filenames
    TorsoFile := UnitProfile.SourceDirectory + '\' + UnitProfile.SourceFilename + Pad3Num(A+32) + '.bmp';
    LegsFile := UnitProfile.SourceDirectory + '\' + UnitProfile.SourceFilename + Pad3Num(A+16) + '.bmp';
    WeaponFile := WeaponInfo.WeaponSoucreDirectory + '\' + WeaponInfo.WeaponFilename + Pad3Num(A) + '.bmp';

    //set arm left/right frame filenames
    case UnitProfile.WeaponType of
      Unarmed  :  begin
                    LeftArmFile := UnitProfile.SourceDirectory + '\' + UnitProfile.SourceFilename + Pad3Num(A) + '.bmp';
                    RightArmFile := UnitProfile.SourceDirectory + '\' + UnitProfile.SourceFilename + Pad3Num(A+8) + '.bmp';
                  end;
      Pistol : begin
                 LeftArmFile := UnitProfile.SourceDirectory + '\' + UnitProfile.SourceFilename + Pad3Num(A) + '.bmp';
                 RightArmFile := UnitProfile.SourceDirectory + '\' + UnitProfile.SourceFilename + Pad3Num(232+A) + '.bmp';
               end;
      Heavy : begin
                LeftArmFile := UnitProfile.SourceDirectory + '\' + UnitProfile.SourceFilename + Pad3Num(240+A) + '.bmp';
                RightArmFile := UnitProfile.SourceDirectory + '\' + UnitProfile.SourceFilename + Pad3Num(248+A) + '.bmp';
              end;
    end;

    //set bob
    VerticalBobOffset := 0;

    //create blank image
    NewImage := TImage.Create(nil);
    BlankImage(NewImage,32,40);

    //create image
    NewImage := CreateImage(A,VerticalBobOffset, TorsoFile, LegsFile, WeaponFile, LeftArmFile, RightArmFile);

    //set destination frame number
    DestinationFrameNum := 8 - A;

    //save the now created image
    NewImage.Picture.Bitmap.SaveToFile(UnitProfile.OutputDirectory + '\' + UnitProfile.UnitName + Pad4Num(DestinationFrameNum) + '.bmp');

    //update file list
    FileList.Add(inttostr(DestinationFrameNum) + '=' + UnitProfile.OutputDirectory + '\' + UnitProfile.UnitName + Pad4Num(DestinationFrameNum) + '.bmp');

    //free up image
    NewImage.Free;
  end;

  //****Walking Frames****
  for A := 1 to 8 do //A is the facing
  begin
    for B := 1 to 8 do //B is the anim frame
    begin
      //set body/weapon/legs frame filenames
      tempint := (A - 1) * 24;
      TorsoFile := UnitProfile.SourceDirectory + '\' + UnitProfile.SourceFilename + Pad3Num(A + 32) + '.bmp';
      LegsFile := UnitProfile.SourceDirectory + '\' + UnitProfile.SourceFilename + Pad3Num(56 + B + tempint) + '.bmp';
      WeaponFile := UnitProfile.SourceDirectory + '\' + UnitProfile.SourceFilename + Pad3Num(A) + '.bmp';
      //VerticalWeaponOffset=5 //(5 pixels DOWN)

      //set arm left/right frame numbers
      case UnitProfile.WeaponType of
        Unarmed  :  begin
                      LeftArmFile := UnitProfile.SourceDirectory + '\' + UnitProfile.SourceFilename + Pad3Num(40+B+tempint) + '.bmp';
                      RightArmFile := UnitProfile.SourceDirectory + '\' + UnitProfile.SourceFilename + Pad3Num(48+B+tempint) + '.bmp';
                    end;
        Pistol : begin
                   LeftArmFile := UnitProfile.SourceDirectory + '\' + UnitProfile.SourceFilename + Pad3Num(40+B+tempint) + '.bmp';
                   RightArmFile := UnitProfile.SourceDirectory + '\' + UnitProfile.SourceFilename + Pad3Num(232+A) + '.bmp';
                 end;
        Heavy : begin
                  LeftArmFile := UnitProfile.SourceDirectory + '\' + UnitProfile.SourceFilename + Pad3Num(240+A) + '.bmp';
                  RightArmFile := UnitProfile.SourceDirectory + '\' + UnitProfile.SourceFilename + Pad3Num(248+A) + '.bmp';
                end;
      end;

      //set bob offset
      case B of
        1 : VerticalBobOffset := 0;
        2 : VerticalBobOffset := -1;
        3 : VerticalBobOffset := -2;
        4 : VerticalBobOffset := -1;
        5 : VerticalBobOffset := 0;
        6 : VerticalBobOffset := -1;
        7 : VerticalBobOffset := -2;
        8 : VerticalBobOffset := -1;
      end;

      //create blank image
      NewImage := TImage.Create(nil);
      BlankImage(NewImage,32,40);

      //create image
      NewImage := CreateImage(A,VerticalBobOffset, TorsoFile, LegsFile, WeaponFile, LeftArmFile, RightArmFile);

      case A of
        1 : tempint := 7;
        2 : tempint := 6;
        3 : tempint := 5;
        4 : tempint := 4;
        5 : tempint := 3;
        6 : tempint := 2;
        7 : tempint := 1;
        8 : tempint := 0;
      end;

      //set destination frame number
      DestinationFrameNum := 7 + (tempint*8) + B;

      //save the now created image
      NewImage.Picture.Bitmap.SaveToFile(UnitProfile.OutputDirectory + '\' + UnitProfile.UnitName + Pad4Num(DestinationFrameNum) + '.bmp');

      //update file list
      FileList.Add(inttostr(DestinationFrameNum) + '=' + UnitProfile.OutputDirectory + '\' + UnitProfile.UnitName + Pad4Num(DestinationFrameNum) + '.bmp');
      //FrameNumber.Insert

      //free up image
      NewImage.Free;
    end;
  end;
  result := FileList;
end;
  
function TProcess.CreateImage(AngleNum, VerticalBobOffset : integer; TorsoFile, LegsFile, WeaponFile, LeftArmFile, RightArmFile : string) : TImage;
var NewImage, ImageX : TImage;
begin
  //create blank image
  NewImage := TImage.Create(nil);
  BlankImage(NewImage,32,40);

  //begin copying to image
  if ((AngleNum = 8) or (AngleNum = 1)) then
  begin
    //Superimpose Weapon (w/ Weapon+Bob offsets)
    ImageX := TImage.Create(nil);
    ImageX.Picture.Bitmap.LoadFromFile(WeaponFile);
    SuperImposevertOffset(addr(ImageX),addr(NewImage),UnitProfile.WeaponVerticalOffset+VerticalBobOffset);
    ImageX.Free;
    //Superimpose LeftArm (w/ Bob offset)
    ImageX := TImage.Create(nil);
    ImageX.Picture.Bitmap.LoadFromFile(LeftArmFile);
    SuperImposevertOffset(addr(ImageX),addr(NewImage),VerticalBobOffset);
    ImageX.Free;
    //Superimpose Legs
    ImageX := TImage.Create(nil);
    ImageX.Picture.Bitmap.LoadFromFile(LegsFile);
    SuperImpose(addr(ImageX),addr(NewImage));
    ImageX.Destroy;
    //Superimpose Torso (w/ Bob offset)
    ImageX := TImage.Create(nil);
    ImageX.Picture.Bitmap.LoadFromFile(TorsoFile);
    SuperImposevertOffset(addr(ImageX),addr(NewImage),VerticalBobOffset);
    ImageX.Free;
    //Superimpose Right Arm (w/ Bob offset)
    ImageX := TImage.Create(nil);
    ImageX.Picture.Bitmap.LoadFromFile(RightArmFile);
    SuperImposevertOffset(addr(ImageX),addr(NewImage),VerticalBobOffset);
    ImageX.Free;
  end;

  if ((AngleNum = 2) or (AngleNum = 3)) then
  begin
    //Superimpose LeftArm (w/ Bob offset)
    ImageX := TImage.Create(nil);
    ImageX.Picture.Bitmap.LoadFromFile(LeftArmFile);
    SuperImposevertOffset(addr(ImageX),addr(NewImage),VerticalBobOffset);
    ImageX.Free;
    //Superimpose Legs
    ImageX := TImage.Create(nil);
    ImageX.Picture.Bitmap.LoadFromFile(LegsFile);
    SuperImpose(addr(ImageX),addr(NewImage));
    ImageX.Destroy;
    //Superimpose Torso (w/ Bob offset)
    ImageX := TImage.Create(nil);
    ImageX.Picture.Bitmap.LoadFromFile(TorsoFile);
    SuperImposevertOffset(addr(ImageX),addr(NewImage),VerticalBobOffset);
    ImageX.Free;
    //Superimpose Weapon (w/ Weapon+Bob offsets)
    ImageX := TImage.Create(nil);
    ImageX.Picture.Bitmap.LoadFromFile(WeaponFile);
    SuperImposevertOffset(addr(ImageX),addr(NewImage),UnitProfile.WeaponVerticalOffset+VerticalBobOffset);
    ImageX.Free;
    //Superimpose Right Arm (w/ Bob offset)
    ImageX := TImage.Create(nil);
    ImageX.Picture.Bitmap.LoadFromFile(RightArmFile);
    SuperImposevertOffset(addr(ImageX),addr(NewImage),VerticalBobOffset);
    ImageX.Free;
  end;

  if ((AngleNum = 4) or (AngleNum = 5)) then
  begin
    //Superimpose Right Arm (w/ Bob offset)
    ImageX := TImage.Create(nil);
    ImageX.Picture.Bitmap.LoadFromFile(RightArmFile);
    SuperImposevertOffset(addr(ImageX),addr(NewImage),VerticalBobOffset);
    ImageX.Free;
    //Superimpose Legs
    ImageX := TImage.Create(nil);
    ImageX.Picture.Bitmap.LoadFromFile(LegsFile);
    SuperImpose(addr(ImageX),addr(NewImage));
    ImageX.Destroy;
    //Superimpose Torso (w/ Bob offset)
    ImageX := TImage.Create(nil);
    ImageX.Picture.Bitmap.LoadFromFile(TorsoFile);
    SuperImposevertOffset(addr(ImageX),addr(NewImage),VerticalBobOffset);
    ImageX.Free;
    //Superimpose LeftArm (w/ Bob offset)
    ImageX := TImage.Create(nil);
    ImageX.Picture.Bitmap.LoadFromFile(LeftArmFile);
    SuperImposevertOffset(addr(ImageX),addr(NewImage),VerticalBobOffset);
    ImageX.Free;
    //Superimpose Weapon (w/ Weapon+Bob offsets)
    ImageX := TImage.Create(nil);
    ImageX.Picture.Bitmap.LoadFromFile(WeaponFile);
    SuperImposevertOffset(addr(ImageX),addr(NewImage),UnitProfile.WeaponVerticalOffset+VerticalBobOffset);
    ImageX.Free;
  end;

  if ((AngleNum = 6) or (AngleNum = 7)) then
  begin
    //Superimpose Right Arm (w/ Bob offset)
    ImageX := TImage.Create(nil);
    ImageX.Picture.Bitmap.LoadFromFile(RightArmFile);
    SuperImposevertOffset(addr(ImageX),addr(NewImage),VerticalBobOffset);
    ImageX.Free;
    //Superimpose Weapon (w/ Weapon+Bob offsets)
    ImageX := TImage.Create(nil);
    ImageX.Picture.Bitmap.LoadFromFile(WeaponFile);
    SuperImposevertOffset(addr(ImageX),addr(NewImage),UnitProfile.WeaponVerticalOffset+VerticalBobOffset);
    ImageX.Free;
    //Superimpose Legs
    ImageX := TImage.Create(nil);
    ImageX.Picture.Bitmap.LoadFromFile(LegsFile);
    SuperImpose(addr(ImageX),addr(NewImage));
    ImageX.Destroy;
    //Superimpose Torso (w/ Bob offset)
    ImageX := TImage.Create(nil);
    ImageX.Picture.Bitmap.LoadFromFile(TorsoFile);
    SuperImposevertOffset(addr(ImageX),addr(NewImage),VerticalBobOffset);
    ImageX.Free;
    //Superimpose LeftArm (w/ Bob offset)
    ImageX := TImage.Create(nil);
    ImageX.Picture.Bitmap.LoadFromFile(LeftArmFile);
    SuperImposevertOffset(addr(ImageX),addr(NewImage),VerticalBobOffset);
    ImageX.Free;
  end;

  //return the new image
  result := NewImage;
  //NewImage.free;
end;