Added initial support for loops