Removed unnecessary loop as pointed out in Dr. Brinkman's email.