Completed a basic example of using setTimeout to mimic setInterval. Also includes a gate.