using more than one loop