switched to recursive functions rather then queing up all those settimeouts