driver function edited
fuctions length fixed