alternate simplified loop for speed comparison