why on earth did I make those two separate loops