Added support for loops.