implement simple for loop