added an each functon