Update 2.js

refactored to cause delay of each subsequent execution of waitFor