switched the main loop function to use setInterval. not sure why I didn't use that right away...