loops looping over arrays corrections