Redoing the loops slightly