update benchmark.py

clean up code and do the better update alg