close to the final version of driving2.py