added cases for empty lists, now supporting functions without args