added more kinds of loops