re-did the loops