Updated to run in loop.