adding for-each tuple element function