fpr loop refactored