added time measurement and changed legion scripts