disallow overlapping instances
fix error with for-loop
add test for loops