Arduino serial console

I have a graphic LCD with the KS0108 controller and I’m using the library from the Arduino Playground.

I’ve tried to output text from the serial port to the LCD and that works.
Now I want to output multiple lines of text that start at the bottom of the LCD and scroll op like the command prompt in windows.

When i run this code only random characters are outputted to the display:

#include <ks0108.h>
#include <Arial14.h>
#include "SystemFont5x7.h"
#include "M2Icon.h"

int regel=0;
char* regels[]={"                      ","                      ","                      ","                      ","                      ","                      ","                      ","                      "};
char temp[22];
void setup(){

  GLCD.Init(NON_INVERTED);   // initialise the library
  GLCD.ClearScreen();  
  GLCD.DrawBitmap(M2Icon, 0,0, BLACK); //draw the bitmap at the given x,y position
  delay(5000);
  GLCD.ClearScreen();
  GLCD.SelectFont(System5x7);       // select fixed width system font 
  Serial.begin(9600);
  GLCD.CursorTo(0,0);
}

void loop(){ // run over and over again
  if(Serial.available()>0){
    char a=Serial.read();
    Serial.println(a,HEX);
    if(a==0xD){
      regels[0]=0;
      regels[0]=regels[1];
      regels[1]=0;
      regels[1]=regels[2];
      regels[2]=0;
      regels[2]=regels[3];
      regels[3]=0;
      regels[3]=regels[4];
      regels[4]=0;
      regels[4]=regels[5];
      regels[5]=0;
      regels[5]=regels[6];
      regels[6]=0;
      regels[6]=regels[7];
      regels[7]=0;
      redraw();
    }else{
      char b[2];
      b[0]=a;
      b[1]=0x00;
      temp=regels[7];
      
      strcat(temp,b);
      regels[7]=0;
      regels[7]=temp;
      redraw();
    }
  }
  
}

void redraw(){
  GLCD.ClearScreen();
  for(int y=0;y<8;y++){
    GLCD.CursorTo(0,y);
    Serial.print("Writing line ");
    Serial.println(y);
    Serial.print("Line contains: ");
    Serial.println(regels[y]);
    GLCD.Puts(regels[y]);
  }
}