Code cleanup, restored previous while loop to create arrays ($db->fetch_array actually DOESN'T build the array we want)