combine scanner to main.c