This seems a bit complicated. Is the wait between loops really necessary?