wrote simple for loop