Add scripting and sorting code, modify drive.h