Add loop

There was a comment that said ('Here if somebody could find how to do it easily for all the flags it would be awesome') , so I did.