Added support for loops