Modified function call for loop on inputs