Modified the console.c code