Working somewhat
Added support for nested loops, still segfaults sometimes