implemented FOR loops