main.c and system.h included
made some minor changes