Added closest region function, driver query and shell script