this code is a working prototype with driver modifications