appendPrgram modified