added dbgcounter
getchar was always returning -1
speed set to 9600