Combine for-loops and add usage notes