modified mohan.c