little chcanges to main.c