This second loop seems unnecessary.