Changed map and for-each to support multiple arguments