edited mode.c again