Implements  function for lists.