modified drive.c