added: nested loops