Add sample loop code
Add loop structure parsing
Pull in upstream changes