Properly looping now and not doing duplicates.