updated intermediate.c